// Ionic Starter App

angular.module('weChat', [
    'ionic',
    'weChat.routes',
    'weChat.controllers',
    'weChat.services',
    "weChat.directives"
  ])
  .config(['$ionicConfigProvider', function ($ionicConfigProvider) {
    $ionicConfigProvider.tabs.position('bottom'); // other values: top
    /*   $ionicConfigProvider.scrolling.jsScrolling(false);*/
  }])
  .run(function ($ionicPlatform, $http, messageService, dateService) {
    var url = "";
    if (ionic.Platform.isAndroid()) {
      url = "/android_asset/www/";
    }
    $http.get(url + "data/json/messages.json").then(function (response) {
      // localStorageService.update("messages", response.data.messages);
      messageService.init(response.data.messages);

    });
    $http.get(url + "data/json/friends.json").then(function (response) {
      /*console.log(response.data.results);*/
    });

    $ionicPlatform.ready(function () {

      if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);
      }
      if (window.StatusBar) {
        StatusBar.styleDefault();
      }
    });
  });
